package org.test.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.test.dao.OrdersMapper;
import org.test.service.OrdersService;
import org.test.vo.Orders;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    //注入DAO层
    @Autowired
    OrdersMapper ordersMapper;

    @Override
    public List<Orders> getAllOrders() {
        List<Orders>  list= ordersMapper.getAllOrders();
        return list;
    }

    @Override
    public int addOrder(int id, int bookId, String bookName, int orderNum, String consignee, String address, String contactWay, int orderPrice, String createTime) {
        return ordersMapper.addOrder(id,bookId,bookName,orderNum,consignee,address,contactWay,orderPrice,createTime);
    }

    @Override
    public int deleteOrder(int orderid) {
     return ordersMapper.deleteOrder(orderid);
    }
}
